package com.htu.courseService.common.enums;

import lombok.Getter;

@Getter
public enum ErrorCodeEnum {
    EXCEL_NOT_FOUND(501,"上传Excel文件为空"),
    UPLOAD_EXCEL_FAIL(502,"导入excel失败，请重新导入"),
    USERNAME_NOT_FOUND(503,"用户名不能为空"),
    MAIL_NOT_FOUND(504,"邮箱不能为空"),
    REGISTER_CODE_NOT_FOUND(505,"验证码不能为空"),
    USERNAME_NOT_REPEAT(506,"用户名不能重复"),
    REGISTER_CODE_NOT_REPEAT(507,"验证码不存在"),
    USER_NOT_REGISTER(508,"用户未注册成功，请重新注册"),
    ROLE_NOT_FOUND(509,"角色不能为空"),
    PASSWORD_NOT_NULL(510,"密码不能为空"),
    PASSWORD_NOT_EQUAL(511,"两次密码不相等"),
    UPDATE_PASSWORD_FAIL(512,"修改密码失败，请重新修改！"),
    COURSE_NAME_NOT_FOUND(513,"课程名称不能为空"),
    INSERT_FAIL(514,"新增失败，请重新添加！"),
    DELETE_FAIL(515,"删除失败，请重新删除！"),
    UPDATE_FAIL(516,"更新失败，请重新更新！"),
    USER_NOT_FOUND(517,"不存在该用户"),
    COURSE_ID_NOT_FOUND(518,"课程id不能为空"),
    USER_COURSE(519,"你已经学习此课程"),
    USER_COURSE_NULL(520,"你目前没有权限学习此课程，请先学习此课程！");
    private Integer code;
    private String msg;

    ErrorCodeEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public void setCode(Integer code) {
        this.code = code;
    }


    public void setMsg(String msg) {
        this.msg = msg;
    }

    @Override
    public String toString() {
        return super.toString();
    }
}
